(function () {
    'use strict';

    angular.module('BlurAdmin.pages.member')
        .controller('MemberInfoCtrl', MemberInfoCtrl);

    /** @ngInject */
    function MemberInfoCtrl($stateParams,$scope,MemberModel,Constants,fileReader,$filter,AppUtils,$http,toastr,API,$state) {
        var vm = this;
        vm.member = {};

        var memberId = $stateParams.memberId;
        if(!AppUtils.isUndefinedOrNull(memberId)){
            MemberModel.getMemberInfo({id:memberId}).$promise.then(function(response){
                if(!AppUtils.isUndefinedOrNull(response.memberInfo)){
                    vm.member= _.clone(response.memberInfo);
                }
            });
        }else{
            AppUtils.alert("请先选择成员！");
            AppUtils.goBack();
        }

        $scope.goBack = function(){
            AppUtils.goBack();
        }

        $scope.edit = function(){
            $state.go("member.edit",{memberId:memberId})
        }

    }

})();
